package store

import "mig/pkg/types"

type DigestStore interface {
	GetDigestTree(id string) (*types.DigestTree, error)
	StoreDigestTree(id string, dt *types.DigestTree) error
}

func NewDigestStore(config *types.StoreConfig) DigestStore {
	switch {
	case config.JSONStoreConfig != nil:
		return NewJSONStore(config.JSONStoreConfig.WorkDir)
	}
	return nil
}
